/**
 * 获取个人信息
 * 
 * /general/getdetail
 */

const $ = require('../../utils/common')
const User_Info = require('../../models/usersInfo')

const get_detail = async function(req, res) {
    try {
        const user_name = req.user_name + ''

        user_data = await User_Info.findOne({
            where: {
                user_name : user_name
            },
            // attributes: ['user_name', 'user_fullname', 'user_sex', 'user_shengyuan', 'user_class', 'user_major', 'user_address', 'user_id_card', 'user_phone', 'user_phone', 'user_short_number', 'user_email', 'user_qq', 'user_wechat'],
        })

        res.json({
            code: 200,
            data: user_data.dataValues
        })
        return
    }
    catch(err) {
        $.sendMessage(res, 0000, "err:" + err)
        return
    }
}

module.exports = get_detail